<template>
<div class="use-textarea-autosize">
  <textarea
    ref="textareaRef"
    v-model="input"
    placeholder="输入内容"
  ></textarea>
  <div v-text="input"></div>
</div>
</template>

<script setup lang="ts">
import { useTextareaAutosize } from "@vueuse/core";
import { ref } from "vue";

defineOptions({
  name: "UseTextareaAutosize"
})
const textareaRef = ref<HTMLTextAreaElement | null>(null)
const { input } = useTextareaAutosize({ element: textareaRef })
</script>

<style scoped lang="css">
.use-textarea-autosize {

}
</style>
